<?php
class JSlideshow extends CWidget
{
	public $assets_url = '';
	public function init()
	{
		$dir = dirname(__FILE__).'/assets/jslide';
		$this->assets_url = Yii::app()->getAssetManager()->publish($dir);
		$cs = Yii::app()->getClientScript();
		$cs->registerScriptFile("{$this->assets_url}/js/jquery.jshowoff.js");
		$cs->registerCssFile("{$this->assets_url}/css/jshowoff.css"); 
		$cs->registerScript(
				'slide',
				"$('#features').jshowoff();",
				CClientScript::POS_READY
		);
		parent::init();
	}
	public function run()
	{
		$data = FrontendGalleryItemsModel::model()->findAll('catid=1');
		$this->render('jslide', array('data'=>$data));
	}
}